UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7kNL8GnPzAPyM/U9IiR58KMqaTNFwkVUN0WGg5zGzdk=' 
WHERE 
  key_id = '8c8a9ac85d1515544972431143a8f996920e74b1f05edb927244d103e99a6d10' 
  AND (
    token = '7kNL8GnPzAPyM/U9IiR58KMqaTNFwkVUN0WGg5zGzdk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034