UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wMmKWK8K1klbDJ9AZebdIZy08bCDLFBPDQqnkcRFuTU='
WHERE
key_id = 'd5610ef22266d0f009fd89e143414a3cf0983445f20f5c326de238bf8ce93960'
AND (
token = 'wMmKWK8K1klbDJ9AZebdIZy08bCDLFBPDQqnkcRFuTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)