UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8kBmpBT/KewnqzLWEkiV3cGNn3Ts2S5yGTurkrSH6FU='
WHERE
key_id = '1cf363f1084fb0d567f59dddc1e679e54fa87d02dfc720a6a45daaadef8dedd4'
AND (
token = '8kBmpBT/KewnqzLWEkiV3cGNn3Ts2S5yGTurkrSH6FU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)