UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VIeF/rt/z3kTxZFjI3b8mkfV80IkW582HyMrdOW1OzA=' 
WHERE 
  key_id = 'b1044a5a6f854e96d0ebfb9e1b44909fde677ff0d9e22a6b2dbb036247eb51ee' 
  AND (
    token = 'VIeF/rt/z3kTxZFjI3b8mkfV80IkW582HyMrdOW1OzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032