UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kvX0Eh1IEUNDvQZRiDyupixsreMnGL/OoX8K8ph2KFc=' 
WHERE 
  key_id = '43c39619dcf1a07713d3c2beb75084955d4f796018fff0986a1c9b4b749cc472' 
  AND (
    token = 'kvX0Eh1IEUNDvQZRiDyupixsreMnGL/OoX8K8ph2KFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016