UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z58Hq3BRaKYOgP4nEfSwPTFzEEBBbtIUgGH1A0MPAAY='
WHERE
key_id = '8694232d70ff4bfb2e9edf80591d8707df7dc2e77ecf8c7ada3b65765ecb7a98'
AND (
token = 'z58Hq3BRaKYOgP4nEfSwPTFzEEBBbtIUgGH1A0MPAAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)