UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sTm4+tb7CDp3pcr0kThOA0erHz+g3akfOGZxUnvOzHc='
WHERE
key_id = '72e305039b5a5d7f46216a97bbe2f44c29efa18c4af1bdc42452e16c5e455609'
AND (
token = 'sTm4+tb7CDp3pcr0kThOA0erHz+g3akfOGZxUnvOzHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)