UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3sVsuItFWpWnNiC3ZZmv4+9Sih5GxI925Ko7Yfy65Ig=' 
WHERE 
  key_id = 'a31ed061cfdc3e33470b2669059d56cb8006d75c1a87b241e5b401e41244168a' 
  AND (
    token = '3sVsuItFWpWnNiC3ZZmv4+9Sih5GxI925Ko7Yfy65Ig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017