UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MmgqyEkbOyIf6dKG60CbfLE7NXQxgfmeLMGvi/KHoY0='
WHERE
key_id = '25f076b611472171a184b73ca0fc2c71a2da001063a866b7b415935f43a60b79'
AND (
token = 'MmgqyEkbOyIf6dKG60CbfLE7NXQxgfmeLMGvi/KHoY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)