UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uO/C6M4mfmfEBIaPQ0v2cFggQHVVw+kSwfhdD8kMk3I='
WHERE
key_id = '6fe53e9ddb350b9969ebc02571e5acb88f0fd00f9a70b019cb088c711ecd1066'
AND (
token = 'uO/C6M4mfmfEBIaPQ0v2cFggQHVVw+kSwfhdD8kMk3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)