UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3sC/VyJu4+ZtozllvaQXn0XYIOMcLr7Pk+ncC2/I/ps=' 
WHERE 
  key_id = '42e6326bcbea0ad8e78b54953dcba3f721220a15d03e3b6dfacef050d98fc7e9' 
  AND (
    token = '3sC/VyJu4+ZtozllvaQXn0XYIOMcLr7Pk+ncC2/I/ps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027