UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+T2rwUK/Icp1MTDTUSDAyQCpm3tIvSZBFsGzWatf5sc='
WHERE
key_id = 'c77619c37697cada796346cfc5eecf1739f74c00bdb0e91c7d1b7921ca2ba81f'
AND (
token = '+T2rwUK/Icp1MTDTUSDAyQCpm3tIvSZBFsGzWatf5sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)