UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9zQB2re1XxvxpQqKomyMyGJ2n7NIGPFdkN37Y9ZaeRQ='
WHERE
key_id = '0f18a9699c1238ca125bbee6ea1c254575be0d327613292a4c52b735a2a1adbb'
AND (
token = '9zQB2re1XxvxpQqKomyMyGJ2n7NIGPFdkN37Y9ZaeRQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)