UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MXcekMzH3qn5DIPJw9cxZMymJXLfGEGhJixQeQNLjx0='
WHERE
key_id = '5d27c157afa664481a09daace5f76fab865bf7f36769009e755d988d51fd7e88'
AND (
token = 'MXcekMzH3qn5DIPJw9cxZMymJXLfGEGhJixQeQNLjx0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)