UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rguXfMLXMLItZvbNkqTxCsBrv7hTK4a3nhVKK6+XqXM=' 
WHERE 
  key_id = '62971993dc7f4312e0ae9352c7aac76e5accd1c1a8b9e06e492e1b8c508b8d0e' 
  AND (
    token = 'rguXfMLXMLItZvbNkqTxCsBrv7hTK4a3nhVKK6+XqXM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045