UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CRUM8ywV8Ohoxwe/kip8uNlantUilaDyP7fXIP2xhUg=' 
WHERE 
  key_id = 'dd413112e0c26c97d7f85d8c6f87aeafe19009fcbfd2f13a0fe2d30e4e34e832' 
  AND (
    token = 'CRUM8ywV8Ohoxwe/kip8uNlantUilaDyP7fXIP2xhUg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018