UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eYGhR+PbQBf9wZv/La8alM+3s6hsb8YbLWQlKWJTZtY=' 
WHERE 
  key_id = 'd04f0210f163df4526db0b36379f6c25b3a6d18b436b526ce9f349878faca482' 
  AND (
    token = 'eYGhR+PbQBf9wZv/La8alM+3s6hsb8YbLWQlKWJTZtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030