UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vhvz8rCVdp+zJ3hS35jl1RisTyfu/RYJslqlUgxf2Mo=' 
WHERE 
  key_id = '19b34e43e1dae804e619f498c715cf886e96dfaf5c9d09e951fb3485e15879ee' 
  AND (
    token = 'vhvz8rCVdp+zJ3hS35jl1RisTyfu/RYJslqlUgxf2Mo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041