UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KpfWPnyOS43b9KfKsSWVjW6/sVB9W6VuJMPdPAfVO9g='
WHERE
key_id = '9a572d149ace996254c0ec11c273eb7612617d2a8613fd6a0ff6d4b6be3d5446'
AND (
token = 'KpfWPnyOS43b9KfKsSWVjW6/sVB9W6VuJMPdPAfVO9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)