UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZQ6PpnTnWl3BZHI2DAZDcdllJ8qFgfZgoCegQPP0axI='
WHERE
key_id = 'f67f0209186367bc0fee0d9eecb30953da0af8d07cff8ba82c8a186a7ebcabfc'
AND (
token = 'ZQ6PpnTnWl3BZHI2DAZDcdllJ8qFgfZgoCegQPP0axI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)