UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H59/xzXNiGJKkQdgGP7cu0YroXsaiEgH+3o47Xmnsbc='
WHERE
key_id = '5fe9f2c953553da372406e4f7a30ccc3d564db3abe0ddd9434578b6ea1c10933'
AND (
token = 'H59/xzXNiGJKkQdgGP7cu0YroXsaiEgH+3o47Xmnsbc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)