UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9mPNuNHkFVVCR6Sd8EuZJ7K0WibP9VSG82gnAphUCQo=' 
WHERE 
  key_id = 'fd5a796a529ce9025b4cb291797d34e15e10e0359a13ad484fa7d2aa7f1e6aa0' 
  AND (
    token = '9mPNuNHkFVVCR6Sd8EuZJ7K0WibP9VSG82gnAphUCQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027