UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TrbbYZvUxMZkfFLDTg8YMfYU68aDzmA8G5j7ZZEwvno='
WHERE
key_id = '3bd42da63bb60769639e2aa16ef7176abfffd8ef68ee8f794d4d25a2ffecfb83'
AND (
token = 'TrbbYZvUxMZkfFLDTg8YMfYU68aDzmA8G5j7ZZEwvno='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)