UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AWEfgz9ulkN/u48nGQhKuaIbU1m8XZd9Vf7SJ0f3rIQ='
WHERE
key_id = '915952846b6d3a3bb5257b32040fbe872afec6a90ee563ab928e6a4688b1693a'
AND (
token = 'AWEfgz9ulkN/u48nGQhKuaIbU1m8XZd9Vf7SJ0f3rIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)