UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fd4EClGVsky5b0oI5dKoaHvgw0ptBrC0nlp/hT2wQj4='
WHERE
key_id = 'f636cc5994ae81f0c36f4274942d0f62eb5c30a46ea6add764e86c0003c2e16a'
AND (
token = 'fd4EClGVsky5b0oI5dKoaHvgw0ptBrC0nlp/hT2wQj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)