UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bPdFYeP/VT95YcXD2ch80tX4SP5TiVZEN5tb0KKjNPs=' 
WHERE 
  key_id = '2b3e93df823a0e963c9da50b5d048191a3b41f5edb211c8daf33b3707fed19aa' 
  AND (
    token = 'bPdFYeP/VT95YcXD2ch80tX4SP5TiVZEN5tb0KKjNPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050