UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qIg8odRJBNdnSUYwrRj5jG45zi+b9DSeLreY4Ure7MA='
WHERE
key_id = 'ebb1376d42fa6b5ec799340b93d5b75671ad91ec94a27e551a39b2e7e490d891'
AND (
token = 'qIg8odRJBNdnSUYwrRj5jG45zi+b9DSeLreY4Ure7MA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)