UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QKbsaZPIQvrOmsiahz43vzO9IXq8zibA8s/OLWgbKds='
WHERE
key_id = 'edbeb20daad6906f78b834772e592c3eb40761d96de7e48654a17e6b7db9d198'
AND (
token = 'QKbsaZPIQvrOmsiahz43vzO9IXq8zibA8s/OLWgbKds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)