UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oPsyZmLKNdzuwD7PL/9BSOD+u1IcAqt8tQHCv/aNNYc=' 
WHERE 
  key_id = 'f7e60985cb984fc46ba526b4fb5007ea5ed0ac4cf7271dec7b5f479a5f887b4a' 
  AND (
    token = 'oPsyZmLKNdzuwD7PL/9BSOD+u1IcAqt8tQHCv/aNNYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027