UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xvjMlS4IqJGsurdUrUeQ/X9NKb8kN+FkU2ahZsd9XHs=' 
WHERE 
  key_id = '0944f35e1e9944bf39d7a70763de332ad58179c0c198e88dd1c60656382b4d08' 
  AND (
    token = 'xvjMlS4IqJGsurdUrUeQ/X9NKb8kN+FkU2ahZsd9XHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045