UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'csOPlNj9l6BLYSkmmso4VNKrCgkq7aeuGXGHkLIG18g=' 
WHERE 
  key_id = '73950136f2c13e39b5265bcd1e2ec4c987ca5ca1ca39e72576923bb3fad6b3c8' 
  AND (
    token = 'csOPlNj9l6BLYSkmmso4VNKrCgkq7aeuGXGHkLIG18g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028