UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xQl/xVJKMUD/E2oNRa2W+mB8pGCSg3Tp/NbIWEUNzCQ=' 
WHERE 
  key_id = '485ed3b37f6b7aafcc89dd5eed081cdd88e455afbf907c11b5e8e6dd12241542' 
  AND (
    token = 'xQl/xVJKMUD/E2oNRa2W+mB8pGCSg3Tp/NbIWEUNzCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019