UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fOoEWPZ/5sea4KhLIBB02Cdei6kkuE/+r/2N3NKAF/A='
WHERE
key_id = '2934f0f3acbd1cb13ffddb2dcde4942086ce9f1c2544c2bbb2f6f2661c56a1e9'
AND (
token = 'fOoEWPZ/5sea4KhLIBB02Cdei6kkuE/+r/2N3NKAF/A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)