UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D85TRcvVO0bqu8HpDKSCbGzBCHN90TEvCt2/Y/wTsus='
WHERE
key_id = 'b6bab7d0d31b93dd1c9e66ca5f0d25a3a1cfe079a76f9705737c2257a446cdfb'
AND (
token = 'D85TRcvVO0bqu8HpDKSCbGzBCHN90TEvCt2/Y/wTsus='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)