UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8hqkgPqOMAre+NUA+WUy0Huv+SiqexAVHvqd33lLC4k='
WHERE
key_id = '7c09e14f0df50a3a988501e34cfb3e176f046258b627c9166850c0e7b8e358ff'
AND (
token = '8hqkgPqOMAre+NUA+WUy0Huv+SiqexAVHvqd33lLC4k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)