UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/jmhiIWFQRfNVFTWEsE+h/N5QBnbpPgAjWbBDGRYgrc=' 
WHERE 
  key_id = 'cc5766097c243ee17c9a233e64b6a458c5d7054a393503edd6b7ec560fe1aa4e' 
  AND (
    token = '/jmhiIWFQRfNVFTWEsE+h/N5QBnbpPgAjWbBDGRYgrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025