UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fkePWLgh+M5qW0LC33rEKvyne7Idp0V/oB/K6AAS9FA=' 
WHERE 
  key_id = 'a2ed8753e9de6629bf95a0ff545090c83840a581fbc40ff9842f48fa226cf8bb' 
  AND (
    token = 'fkePWLgh+M5qW0LC33rEKvyne7Idp0V/oB/K6AAS9FA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018