UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JuCwnBVFyU46aFMtpTD09cWvK2OHCYeXtP6mWMBC5os='
WHERE
key_id = '73e6014867ec1fd3bef6af527a352cb97ca4cbd497ccccffd45cbae764dee7e0'
AND (
token = 'JuCwnBVFyU46aFMtpTD09cWvK2OHCYeXtP6mWMBC5os='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)