UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pToNivm/OkcRpG+I+cJ88zoLUY3gZJ9vffGT+k5OC+8='
WHERE
key_id = '2224254adf3e72e48bb213cf6a527e4e631a1bfccfd42cc708c5b0dcf1bb4994'
AND (
token = 'pToNivm/OkcRpG+I+cJ88zoLUY3gZJ9vffGT+k5OC+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)