UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FiGttJNI9oZlKyh/LmUk4GYP94DkdiUsiTne51fBjPE=' 
WHERE 
  key_id = '9776e34ca959d20e16077991236347f02499221c0ad4478d86616fd7aed9bf00' 
  AND (
    token = 'FiGttJNI9oZlKyh/LmUk4GYP94DkdiUsiTne51fBjPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023