UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pug69SBXCRVwBUV03Pc35M+zpgE6OPq68LGV6joKn5o='
WHERE
key_id = '9cd68fe5ac5c2c90b53f7f42b0c7ef1fd4a8060f306b15a654ddda07f67b89be'
AND (
token = 'Pug69SBXCRVwBUV03Pc35M+zpgE6OPq68LGV6joKn5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)