UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TEKpzSq2vE8RSvydIrYnDWuXUxv4MNAaz/yQsdXw3p0='
WHERE
key_id = '28996bbf0074b1d9508b67eb82bdaa1732ec002950b35064bdb16ad65806512d'
AND (
token = 'TEKpzSq2vE8RSvydIrYnDWuXUxv4MNAaz/yQsdXw3p0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)