UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't4/wiXwvK4DcZ8Ytuf/wmAL4fgh/B9Azyr1FnHHXHXg='
WHERE
key_id = '89827e68f208dfa39f80f866a42400ec4d53c375ec03d63c104749e0c31d0507'
AND (
token = 't4/wiXwvK4DcZ8Ytuf/wmAL4fgh/B9Azyr1FnHHXHXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)