UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wDi7Va4VcoIuYAlSKoDJ6rhS8uJqtZWTwBZxH3s5V9Q='
WHERE
key_id = '151ec6a7cd519db4130e2b01fbb73bc6b7ae1b67b9ed7d5cb6e7b1e06bb4882b'
AND (
token = 'wDi7Va4VcoIuYAlSKoDJ6rhS8uJqtZWTwBZxH3s5V9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)