UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'USxWh4rWUmWi3uOsMkIwTZ2D/SmAs7mlPMbGHcO9d5M=' 
WHERE 
  key_id = '96ce04c86bc44ad8f1282a85a56c589d178f9ca8391ed6bd296605b34cb4c768' 
  AND (
    token = 'USxWh4rWUmWi3uOsMkIwTZ2D/SmAs7mlPMbGHcO9d5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023