UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hXpfROfJkIGAWcFz2uR100EuilP0O055lMCN3Ir/mmc='
WHERE
key_id = '9b8aab2659e77be7bb3685e523c7be68e3cd9e0abc733766b3f9e5a0a0657632'
AND (
token = 'hXpfROfJkIGAWcFz2uR100EuilP0O055lMCN3Ir/mmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)