UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iZuFYQYywGBNsLQnXNnEsXFjmxsLnnW36iXy2vwH46U=' 
WHERE 
  key_id = '7e57587cd2e9e435a2f6bafe45baefabe506f5ff5c8044c65e82c37f5f372d7c' 
  AND (
    token = 'iZuFYQYywGBNsLQnXNnEsXFjmxsLnnW36iXy2vwH46U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027