UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PyYlKaBSdnHTqcq5OdqnWfsq3nRNEysEI/vyUGGcYuQ='
WHERE
key_id = '105a96756b3924b57e0d75804bcb1811090882b09baf038396ab2ae4b42ae9a4'
AND (
token = 'PyYlKaBSdnHTqcq5OdqnWfsq3nRNEysEI/vyUGGcYuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)