UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V86//zT7E1ZRkEXhee9da1SATfQXTZdiRGzaqX4ShNA='
WHERE
key_id = 'bd8c7137a2930cb83a0124da0e56e90a3a02d652a59fb68bd428e5f11654204a'
AND (
token = 'V86//zT7E1ZRkEXhee9da1SATfQXTZdiRGzaqX4ShNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)