UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D3h1Qk+Kg8tJthng21N/cUa90Xkh6lm0yw5vhYsKCu8='
WHERE
key_id = '08072f3881cb0c9d02b6e85e3922bb91f7bc1c92eb24a9c1af382f240cbde468'
AND (
token = 'D3h1Qk+Kg8tJthng21N/cUa90Xkh6lm0yw5vhYsKCu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)