UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QZwsKxjKQBsWtJ0B0Vw4nPQf4+YTHVxaxIHFPHDjUFk='
WHERE
key_id = '10fc3cae9dd023760d30c3800ad7cc5f64b52f2fcb4d421020fae57e45b1781e'
AND (
token = 'QZwsKxjKQBsWtJ0B0Vw4nPQf4+YTHVxaxIHFPHDjUFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)