UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iIX08iXGEyrc2Z1zR/z8lpzVTorS6y5KDOSKDn4UhGo=' 
WHERE 
  key_id = '8c6009d39c7e2a86d86a46bb62de304d642aec2fe9dacc122ade75a409bc7f5b' 
  AND (
    token = 'iIX08iXGEyrc2Z1zR/z8lpzVTorS6y5KDOSKDn4UhGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022