UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nYR2P6D0GPcekKGX5l7MIZ4AiZShv3WtyFwEtaY+q2I=' 
WHERE 
  key_id = '921dbbf7792e0159ccbf6daabe03ac27d47c6f4403aea07d45f0dd8592c522f5' 
  AND (
    token = 'nYR2P6D0GPcekKGX5l7MIZ4AiZShv3WtyFwEtaY+q2I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027